<%--
  Created by IntelliJ IDEA.
  User: zhong
  Date: 2023-05-21
  Time: 0:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="beans1.Officebean" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="beans1.Mzbean" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Dashboard</title>
    <link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css" />
    <link rel="stylesheet"  href="./css/button.css" />
</head>
<body class="mdui-theme-primary-teal mdui-theme-accent-teal mdui-drawer-body-left" >



<div class=".mdui-ripple">
    <div class="mdui-toolbar mdui-color-theme">
        <a href="javascript:;" class="mdui-btn mdui-btn-icon">
            <i class="mdui-icon material-icons " id="toggle">menu</i>
        </a>
        <span class="mdui-typo-title">Dashboard</span>
        <div class="mdui-toolbar-spacer"></div>
        <div class="mdui-textfield mdui-textfield-expandable mdui-float-right">
            <button class="mdui-textfield-icon mdui-btn mdui-btn-icon" onclick="searchText()"><i class="mdui-icon material-icons">search</i></button>
            <input id="searchText" class="mdui-textfield-input" type="text" placeholder="Search"/>
            <button class="mdui-textfield-close mdui-btn mdui-btn-icon" ><i class="mdui-icon material-icons">close</i></button>
        </div>
       <a href="javascript:;" class="mdui-btn mdui-btn-icon" onclick="window.location='${pageContext.request.contextPath}/main.jsp'">
            <i class="mdui-icon material-icons">&#xe879;</i>
        </a>
        
    </div>
</div>


<div class="mdui-drawer" id="drawer">
    <ul class="mdui-list">
        <li class="mdui-subheader">医院仪表盘</li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/admin/index.jsp'">
            <i class="mdui-icon material-icons mdui-list-item-icon">&#xe871;</i>
            <div class="mdui-list-item-content">Dashboard</div>
        </li>
        <li class="mdui-subheader" >人员管理</li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/Main_Patient'">
            <i class="mdui-icon material-icons mdui-list-item-icon">&#xe914;</i>
            <div class="mdui-list-item-content">患者信息管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/Main_Doctor'">
            <i class="mdui-icon material-icons mdui-list-item-icon">&#xe566;</i>
            <div class="mdui-list-item-content">医生信息管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/Main_Admin'">
            <i class="mdui-list-item-icon mdui-icon material-icons">&#xe8b8;</i>
            <div class="mdui-list-item-content">管理员信息管理</div>
        </li>

        <li class="mdui-subheader">医院基础信息管理</li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/Main_Office'">
            <i class="mdui-list-item-icon mdui-icon material-icons">drafts</i>
            <div class="mdui-list-item-content">科室信息管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/admin/indentPage.jsp'">
            <i class="mdui-list-item-icon mdui-icon material-icons">email</i>
            <div class="mdui-list-item-content">订单信息管理</div>
        </li>

        <li class="mdui-subheader">医院排班信息管理</li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}/admin/doctorScheduling.jsp'">
            <i class="mdui-list-item-icon mdui-icon material-icons">&#xe05f;</i>
            <div class="mdui-list-item-content">医生排班管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location='${pageContext.request.contextPath}//Main_MZ'">
            <i class="mdui-icon material-icons mdui-list-item-icon">&#xe84f;</i>
            <div class="mdui-list-item-content">门诊管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location.href='${pageContext.request.contextPath}/admin/handleApplication.jsp'" href="javascript:void(0);">
            <i class="mdui-icon material-icons mdui-list-item-icon">&#xe85a;</i>
            <div class="mdui-list-item-content">医生申请处理管理</div>
        </li>
        <li class="mdui-list-item mdui-ripple" onclick="window.location.href='${pageContext.request.contextPath}/admin/doctorArrangeCancel.jsp'" href="javascript:void(0);">
            <i class="mdui-list-item-icon mdui-icon material-icons">&#xe5c9;</i>
            <div class="mdui-list-item-content">医生排班变动管理</div>
        </li>
    </ul>
</div>



<div class="mdui-container">
    <div class="mdui-table-fluid">
        <table class="mdui-table mdui-table-hoverable">
            <thead>
            <td>门诊ID</td>
            <td>门诊名</td>
            <td>所属科室ID</td>
            <td>数据操作</td>
            </thead>
            <tbody>
            <%
                ArrayList<Mzbean> list= (ArrayList<Mzbean>)request.getAttribute("list");
                for(int i=0;i<list.size();i++){
            %>
            <tr>
                <td><%=list.get(i).getId()%></td>
                <td><%=list.get(i).getName()%></td>
                <td><%=list.get(i).getKsid()%></td>
                <td>
                    <form method="post" action="${pageContext.request.contextPath}/admin/editMZ.jsp">
                        <input type="hidden" name="id" value="<%=list.get(i).getId()%>">
                        <input type="hidden" name="name" value="<%=list.get(i).getName()%>">
                        <input type="hidden" name="ksid" value="<%=list.get(i).getKsid()%>">
                        <input type="hidden" name="action" value="editMZ" />
                        <input type="submit" value="修改" class="btn btn1"/>

                    </form>

                    <form method="post" action="${pageContext.request.contextPath}/Main_MZ">
                        <input type="hidden" name="id" value="<%=list.get(i).getId()%>">
                        <input type="hidden" name="action" value="delMZ" />
                        <input type="submit" value="删除" class="btn btn2"/>
                    </form>
                </td>
            </tr>

            <%
                }
            %>

            </tbody>
        </table>
    </div>
</div>


<button class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme" onclick="window.location='${pageContext.request.contextPath}/admin/insertMZ.jsp'">
    <i class="mdui-icon material-icons">add</i>

</button>
<script>
    function searchText() {
        var text = document.getElementById("searchText").value;
        if (text) {
            if (!window.find(text)) {
                alert("未找到指定文本");
            }
        }
    }
</script>
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
<script>
    var $ = mdui.$;
    var inst = new mdui.Drawer('#drawer');
    $('#toggle').on('click', function () {
        inst.toggle();
    });
</script>
</body>
</html>
